package org.colcon.web.model;

import java.util.HashMap;
import java.util.Map;

import org.colcon.web.model.framework.ILaw;

public class Law extends Container implements ILaw
{
	public String getType(){return "law";}
	
	private static final long serialVersionUID = 6349753343373820332L;

	public static final String
	
		// arguments
		TEXT = "text";
	
	public Law()
	{
		this(new HashMap<String, String>());
	}
	
	public Law(Map<String, String> args)
	{
		this(args.get(PARENT), args.get(ID), args.get(TEXT), args.get(CHILDREN));
	}
	
	public Law(String parent, String id, String text, String children)
	{
		super(parent, id, children);
		
		setArg(TEXT, text);
	}
	
	public String getGroup()
	{
		return Group.pathToGroup((getParentPath()));
	}
	
	public void setText(String text)
	{
		setArg(TEXT, text);
	}
}